#!/usr/bin/perl
sub hello(){
 print "hello world\n";
}

sub action(){
	($one, $two, $three) = @_;
    if($one and $two and $three) {
    	print "para: $one, $two, $three\n";
    } else {
    	print "<3 para\n";
    }

    print "$one\n";

}

hello;

$num1 = 1, $num2 = 2, $num3 = 3;

my $add_num = add($num1, $num2);
print "$num1 と $num2 の和はは、 $add_numです。\n\n";

# 2つの数の和を求めるサブルーチン
sub add {
  # shift は暗黙的な引数 @_を受け取り先頭の要素を切り取って返す。
  my $num1 = shift;
  my $num2 = shift;

  my $total = $num1 + $num2;
  return $total;
}

my $total_num = sum($num1, $num2, $num3);
print "$num1,$num2,$num3 の合計は、 $total_num です。\n";

# 複数の数の和を求めるサブルーチン
sub sum {
  my @num_list = @_;

  my $total;
  for my $num (@num_list) {
    $total += $num;
  }
  return $total;
}

# cach 3 de lay doi so la my $num = $_[0];